package com.gaofeng.day12;

public class GirlFriend {
    private int age;

    public GirlFriend(){

    }
    public GirlFriend(int age){
        if(age >= 18 && age <= 50){
            this.age = age;
        }else{
            System.out.println("年龄输入有问题,constructor");
        }
    }

    public void setAge(int value){
        System.out.println(value);
        if(value >= 18 && value <= 50){
            age = value;
        }else{
            System.out.println("年龄输入有问题");
        }
    }
    public int getAge(){
        return age;
    }
}
